# USB OTG ***Copyright © Quectel Wireless Solutions Co., Ltd. 2026. All rights reserved.*** --- **USB On-The-Go** (**USB OTG**) is a supplementary standard to USB 2.0 that allows a device to switch between USB peripheral mode and host mode. Quectel Pi H1 supports USB OTG functionality. Through its onboard Type-C port, you can directly connect USB peripherals (such as USB flash drives, keyboards, mice, and network adapters) in host mode — without needing a PC for data reading or control operations. This document describes how to use the USB Ethernet emulation (RNDIS) feature via the USB OTG interface to establish network connectivity and sharing between Quectel Pi H1 and a host computer. # Hardware interface ```{image} images/image_Wn4DbJyTGo7V8exrPkJcvsEknzb.webp :width: 638px :height: 319px ``` # USB Ethernet Emulation Overview USB Ethernet emulation (RNDIS) creates a virtual Ethernet link between the device and the host over a USB cable, enabling network communication without requiring an additional physical network adapter. Quectel Pi H1's default USB OTG gadget configuration includes RNDIS functionality (bundled with DIAG and ADB). After connection, a `usb0` network interface appears on the Quectel Pi H1 side. Once the connection is established, it can be used for: - Remote login (SSH) - File transfer (SCP / SFTP) - Network sharing (host shares network to device, or device shares network to host) - Debugging service access # Connecting to a Linux Host ## Basic Connection Setup 1. Use a USB data cable to connect the **Type-C** port of Quectel Pi H1 to a **USB** port on the Linux host. 2. On Quectel Pi H1, verify that the `usb0` interface exists, then enable and assign an IP address: ```shell sudo ip link show usb0 sudo ip link set usb0 up sudo ip addr add 192.168.0.5/24 dev usb0 sudo ip addr show usb0 ``` 1. On the Linux host, identify the newly added USB RNDIS network interface name (usually starts with `enx`), for example `enx2a8b155b2e00`: ```shell ip link ``` ```{image} images/image_LHB6bu3mXoqpcQxbw6JcljYvnyd.webp :width: 824px :height: 550px ``` 1. On the Linux host, assign an IP address to this interface: ```shell sudo ip link set enx2a8b155b2e00 up sudo ip addr add 192.168.0.6/24 dev enx2a8b155b2e00 ``` > 1. Replace `enx2a8b155b2e00` with the actual interface name detected on your host. 2. Test connectivity: ```shell ping 192.168.0.5 ``` 1. A successful response indicates the RNDIS connection has been established. ```{image} images/image_Ib1FbD6UkoIkKuxYAWWczz52ngg.webp :width: 824px :height: 550px ``` ## Sharing Network from Linux Host to Device When the Linux host already has internet access via Ethernet or Wi-Fi, you can share the network with Quectel Pi H1. Example parameters: | **Role** | **Interface** | **IP Address** | | --- | --- | --- | | Linux WAN interface | enp11s0 | — | | Linux USB RNDIS interface | enx2a8b155b2e00 | 192.168.0.6 | | Quectel Pi H1 USB interface | usb0 | 192.168.0.5 | > To find the Linux host's WAN interface, run `ip route get 8.8.8.8` — the `dev` field in the output indicates the actual internet-facing interface. Enable IPv4 forwarding on the Linux host: ```shell sudo sysctl -w net.ipv4.ip_forward=1 ``` Configure NAT forwarding on the Linux host: ```shell sudo iptables -t nat -A POSTROUTING -o enp11s0 -j MASQUERADE sudo iptables -A FORWARD -i enx2a8b155b2e00 -o enp11s0 -j ACCEPT sudo iptables -A FORWARD -i enp11s0 -o enx2a8b155b2e00 -m state --state RELATED,ESTABLISHED -j ACCEPT ``` > Replace `enp11s0` and `enx2a8b155b2e00` with your actual interface names. Add a default route on Quectel Pi H1: ```shell sudo ip route replace default via 192.168.0.6 dev usb0 ``` Configure DNS on Quectel Pi H1: ```shell sudo sh -c 'printf "nameserver 8.8.8.8\n" > /etc/resolv.conf' ``` Verify internet access from Quectel Pi H1: ```shell ping 8.8.8.8 ping www.quectel.com ``` > If you can `ping` a public IP but cannot resolve domain names, check the DNS configuration. ## Sharing Network from Device to Linux Host When Quectel Pi H1 already has internet access via another interface (such as Ethernet or cellular), you can share the network with the Linux host. Example parameters: | **Role** | **Interface** | | --- | --- | | Quectel Pi H1 WAN interface | eth0 | | Quectel Pi H1 USB interface | usb0 | | Linux USB RNDIS interface | enx2a8b155b2e00 | > Run `ip route get 8.8.8.8` on Quectel Pi H1 to determine the actual WAN interface. Enable IPv4 forwarding on Quectel Pi H1: ```shell sudo sysctl -w net.ipv4.ip_forward=1 ``` Configure NAT forwarding on Quectel Pi H1: ```shell sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE sudo iptables -A FORWARD -i usb0 -o eth0 -j ACCEPT sudo iptables -A FORWARD -i eth0 -o usb0 -m state --state RELATED,ESTABLISHED -j ACCEPT ``` On the Linux host, point the default route to Quectel Pi H1: ```shell sudo ip route replace default via 192.168.0.5 dev enx2a8b155b2e00 ``` Verify internet access from the Linux host: ```shell ping 8.8.8.8 ping www.quectel.com ``` > If Quectel Pi H1 is connected via cellular or another interface, replace `eth0` with the actual WAN interface. # Connecting to a Windows Host ## Basic Connection Setup 1. Use a USB data cable to connect the **Type-C** port of Quectel Pi H1 to a **USB** port on the Windows host. 2. On Quectel Pi H1, verify that the `usb0` interface exists, then enable and assign an IP address: ```shell sudo ip link show usb0 sudo ip link set usb0 up sudo ip addr add 192.168.7.1/24 dev usb0 sudo ip addr show usb0 ``` 3. On Windows, identify the newly added USB RNDIS adapter. In Device Manager, you will see `Remote NDIS Compatible Device` under Network adapters. A new Ethernet connection will appear in Network Connections. ```{image} images/image_GfGHboiTaocdSextyIZcitlxnYg.webp :width: 775px :height: 572px ``` ```{image} images/image_O61jbkblWokt0txQ5HicCCXmn20.webp :width: 1116px :height: 630px ``` 4. Configure the USB network adapter IP on Windows. Open Network Settings, locate the newly added unidentified network, manually set the IP address to an address in the same subnet as Quectel Pi H1 (e.g., `192.168.7.2`), and save. ```{image} images/image_XbZ0bF0THoGmZKx095IcsEaunZg.webp :width: 954px :height: 705px ``` ```{image} images/image_Q0RCbubuJo6S2fxdyqYcQ9mlndh.webp :width: 941px :height: 697px ``` ```{image} images/image_GGDdbUwTHogBpYxt0cFc120jnQd.webp :width: 946px :height: 701px ``` 5. Test connectivity: ```shell ping 192.168.7.1 ``` A successful response indicates the RNDIS connection has been established. ## Sharing Network from Windows Host to Device When the Windows host already has internet access via Ethernet or Wi-Fi, you can share the network with Quectel Pi H1 using Internet Connection Sharing (ICS). 1. Open the Network Connections page: Press `Win + R`, type `ncpa.cpl`, and press Enter. 2. Enable Internet Connection Sharing: Right-click the network adapter that currently has internet access (e.g., WLAN or Ethernet), select **Properties** → **Sharing** tab, check **Allow other network users to connect through this computer's Internet connection**. ```{image} images/image_F94NbGDZ8oBj0yxkjntcJkv3nMd.webp :width: 375px :height: 499px ``` > 1. After enabling sharing, Windows typically sets the USB RNDIS adapter address to `192.168.137.1/24`. ```{image} images/image_TIwTbpzWyoO5Juxg1HPc9qIynge.webp :width: 797px :height: 705px ``` 1. Reconfigure the `usb0` IP on Quectel Pi H1 (must match the subnet assigned by Windows): ```shell sudo ip addr flush dev usb0 sudo ip link set usb0 up sudo ip addr add 192.168.137.2/24 dev usb0 sudo ip addr show usb0 ``` 1. Add a default route on Quectel Pi H1: ```shell sudo ip route replace default via 192.168.137.1 dev usb0 ``` 1. Configure DNS on Quectel Pi H1: ```shell sudo sh -c 'printf "nameserver 8.8.8.8\n" > /etc/resolv.conf' ``` 1. Verify internet access from Quectel Pi H1: ```shell ping 8.8.8.8 ping www.quectel.com ``` > If you can `ping` a public IP but cannot resolve domain names, check the DNS configuration. If Windows did not set the USB RNDIS adapter to `192.168.137.1`, use the actual IP shown and ensure Quectel Pi H1's `usb0` is in the same subnet. ## Sharing Network from Device to Windows Host When Quectel Pi H1 already has internet access via another interface, you can share the network with the Windows host. > Run `ip route get 8.8.8.8` on Quectel Pi H1 to determine the actual WAN interface. Enable IPv4 forwarding on Quectel Pi H1: ```shell sudo sysctl -w net.ipv4.ip_forward=1 ``` Configure NAT forwarding on Quectel Pi H1: ```shell sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE sudo iptables -A FORWARD -i usb0 -o eth0 -j ACCEPT sudo iptables -A FORWARD -i eth0 -o usb0 -m state --state RELATED,ESTABLISHED -j ACCEPT ``` > If `iptables` is not found, install it via apt: > ```shell sudo apt update sudo apt install iptables ``` On Windows, set the gateway to Quectel Pi H1's IP (e.g., `192.168.7.1`). ```{image} images/image_ECR3bXSHUo41YAxzv1DcpfzLnie.webp :width: 946px :height: 701px ``` Verify internet access from Windows (it is recommended to temporarily disable other network connections to avoid interference): ```shell ping 8.8.8.8 ping www.quectel.com ``` ```{image} images/image_Foznb7czFoMCIgxWuIEcYvB3n2d.webp :width: 886px :height: 559px ``` > If Quectel Pi H1 is connected via cellular or another interface, replace `eth0` with the actual WAN interface. # Troubleshooting | **Symptom** | **Troubleshooting Steps** | | --- | --- | | No usb0 interface on Quectel Pi H1 | Verify the Type-C cable supports data transfer; run sudo qusb showpid to check if the USB composition mode includes RNDIS or NCM | | No new network adapter on the host | Replug the cable and check dmesg \| tail -n 50 (Linux) or Device Manager (Windows) to see if USB Ethernet / RNDIS device is detected | | Can ping public IP but cannot resolve domain names | Check /etc/resolv.conf or system DNS configuration | | Still cannot access the internet after configuring NAT | Verify the default route points to the peer USB adapter address; run iptables -t nat -L -n -v to check if forwarding rules are active |